package com.example.bookservice.service;

import com.example.bookservice.dto.AuthorBookDto;
import com.example.bookservice.dto.BooksDTO;
import com.example.bookservice.dto.RequestParamsDto;
import com.example.bookservice.entity.Book;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.bookservice.entity.Chapter;
import com.example.bookservice.vo.PageResultVo;
import com.example.feign.result.AjaxResult;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 软工2104-李家强-2100770248
 * @since 2023-09-20
 */
public interface BookService extends IService<Book> {


    AjaxResult getAllBooks(BooksDTO booksDTO);

    PageResultVo<?> searchByAuthorOrBook(RequestParamsDto params);

    PageResultVo<?> getAuthorIsAvailableBooks(AuthorBookDto authorBookDtoe);

    AjaxResult insertOrUpdateBook(Book book, String username);

    AjaxResult insertOrUpdateChapter(Long bookId, Chapter chapter);

    PageResultVo<?> getBookInfo(Long targetBook);

    Chapter getChapterInfo(Long targetBook, Long targetChapter);

    AjaxResult getApprovedBookFalse(Integer pageNum, Integer pageSize);

    AjaxResult getApprovedChapterFalse(Integer pageNum, Integer pageSize);

    AjaxResult suggestions(String prefix);

    AjaxResult deleteBookById(Long id);

    AjaxResult deleteChapterById(Long id);

    AjaxResult suggestionChapter(Long bookId, String prefix);
}
